<?php



ini_set('display_errors', 1);
error_reporting(-1);
require_once '/data/wwwroot/g_vendor/autoload.php';


$channel = $argv[1] ?? 0;
if ($channel == 0) exit('no channel');
$size = 1000;
$response = [];
$page = 0;
while (true) {
    $where = [
        'channel' => $channel,
        'LIMIT' => [$size * $page, $size]
    ];
    $ids = \Biz\model\wiki\Wiki::select('id', $where);
    if (empty($ids)) break;
    $page ++;
    $response = array_merge($response, $ids);
}
echo "total : ", count($response), PHP_EOL;
echo implode(',', $response), PHP_EOL;